package com.quartz.demo3;

import org.quartz.CronExpression;

import java.util.Date;

public class GetExpr {
    public static void main(String[] args) {
        CronExpression expression;
        Date curTime = new Date();
        System.out.println(curTime);
        try
        {
            expression = new CronExpression("*/2 * * * * ?");
            for (int i = 0; i < 5; i++) {
                Date newDate = expression.getNextValidTimeAfter(curTime);
                System.out.println(newDate);
                curTime = newDate;
            }


        } catch (Exception e) {
        }

    }
}
